﻿using furion.blog.Domain.Shared.Enum;
using furion.blog.Domain.Shared.ValidateAttribute;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace furion.blog.Domain.Shared.Dto.User
{
    public class UserCreateDto
    {
        public long UserId { get; set; } 

        [JsonProperty(PropertyName = "userName")]
        [Required(ErrorMessage = "请填写账号")]
        public string UserName { get; set; } = String.Empty;

        [JsonProperty(PropertyName = "deptId")]
        [Required(ErrorMessage = "请选择部门")]
        public long? DeptId { get; set; } = null;

        [JsonProperty(PropertyName = "realName")]
        [Required(ErrorMessage = "请填写姓名")]
        public string RealName { get; set; } = string.Empty;


        [JsonProperty(PropertyName = "roleId")]
        [Required(ErrorMessage = "请选择角色")]
        public long? RoleId { get; set; } = null;

        [JsonProperty(PropertyName = "password")]
        [Required(ErrorMessage = "请填写密码")]
        public string Password { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "nickName")]
        public string NickName { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "phone")]
        [PhoneValidateAttribute(ErrorMessage = "电话格式有误")]
        public string Phone { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "sex")]
        [Required(ErrorMessage = "请选择性别")]
        public string Sex { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "remark")]
        public string Remark { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "email")]
        public string Email { get; set; } = string.Empty;

        [JsonProperty(PropertyName = "avatar")]
        public string Avatar { get; set; } = string.Empty;

        public long? CreatedBy { get; set; } = null;
        public long? UpdatedBy { get; set; } = null;

        public DateTime? CreatedTime { get; set; } = DateTime.Now;
        public DateTime? UpdatedTime { get; set; } = DateTime.Now;
        public string Status { get; set; } = StatusEnum.Normal.ToString();
        public string IsDelete { get; set; } = YesOrNoEnum.No.ToString();
        public string IsSuperAdmin { get; set; } = YesOrNoEnum.No.ToString();
        public string LoginIp { get; set; } = string.Empty;

        public string UserType { get; set; } = "00";

    }
}
